Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
@uiw/react-amap-require-script
Advanced tools
用于加载高德地图其它 SDK 依赖,官方示例中的 css, js加载。
import { APILoader } from '@uiw/react-amap';
// 或者单独安装使用
import { APILoader } from '@uiw/react-amap-require-script';
import ReactDOM from 'react-dom';
import React, { useState, useRef } from 'react';
import { Map, APILoader, MassMarks } from '@uiw/react-amap';
const Example = (props) => {
const [show, setShow] = useState(true);
const [points, setPoints] = useState([]);
const map = useRef()
const marker = useRef()
useEffect(() => {
if(points.length === 0) {
requireScript('https://a.amap.com/jsapi_demos/static/citys.js', 'citys_id').then(() => {
if(citys && Array.isArray(citys)) {
setPoints(citys);
}
});
}
});
return (
<>
<button onClick={() => setShow(!show)}>
{show ? '隐藏' : '显示'}
</button>
<div style={{ width: '100%', height: '300px' }}>
<Map zoom={4}>
<MassMarks
visiable={show}
data={points}
onMouseMove={(evn) => {
if (!map.current) {
map.current = evn.target.getMap();
if (!marker.current) {
marker.current = new AMap.Marker({ content: ' ', map: map.current });
}
}
if (marker.current) {
marker.current.setPosition(evn.data.lnglat);
marker.current.setLabel({content: evn.data.name})
}
}}
/>
</Map>
</div>
</>
);
}
ReactDOM.render((
<APILoader akay="a7a90e05a37d3f6bf76d4a9032fc9129">
<Example />
</APILoader>
), _mount_);
/**
* load SDK by css tag
*/
export declare function requireCss(src: string): Promise<void>;
/**
* load SDK by script tag
*/
export declare function requireScript(src: string, id?: string): Promise<void>;
FAQs
基于 React 封装的高德地图组件。AMap Component Based On React.
The npm package @uiw/react-amap-require-script receives a total of 92 weekly downloads. As such, @uiw/react-amap-require-script popularity was classified as not popular.
We found that @uiw/react-amap-require-script demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.